package com.techsoul.module.pms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDeliveryLine;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialDeliveryLineSearchParam;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryLineVo;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryLineptVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 出库明细Mapper接口
 * 
 * @author liuen
 * @date 2022-01-25
 */
public interface TbWmsMaterialDeliveryLineMapper extends BaseMapper<TbWmsMaterialDeliveryLine> {

    /**
     * 详情
     * @param id
     * @return
     */

    TbWmsMaterialDeliveryLineVo findById(String id);
    TbWmsMaterialDeliveryLine findBySapOrderNo(@Param("sapOrderNo") String sapOrderNo,@Param("vinNo") String vinNo);
    TbWmsMaterialDeliveryLine findBySapOrderNo2(@Param("sapOrderNo") String sapOrderNo,@Param("vinNo") String vinNo,@Param("deliveryWarehouseType") String deliveryWarehouseType
            ,@Param("status") String status);
    List<TbWmsMaterialDeliveryLineVo> findByReciptLineId(@Param("reciptLineId") String reciptLineId);
    List<TbWmsMaterialDeliveryLine> findByRfid(@Param("rfidCode") String rfidCode);
    List<TbWmsMaterialDeliveryLineVo> findSkuCtOutBoundList();
    List<TbWmsMaterialDeliveryLine> findBySupplierNoAndMaterialNoAndOrderNo
            (@Param("supplierNo") String supplierNo,@Param("materialNo") String materialNo,@Param("orderNo") String orderNo);
    /**
     * 列表
     * @param params
     * @return
     */
    List<TbWmsMaterialDeliveryLineVo> findAll(@Param("params") TbWmsMaterialDeliveryLineSearchParam params);
    List<TbWmsMaterialDeliveryLine> findByDeliveryId(@Param("deliveryId") String deliveryId);

    List<TbWmsMaterialDeliveryLine> findAllOrderByMaterial(@Param("params") TbWmsMaterialDeliveryLineSearchParam params);
    int ctLines(@Param("deliveryId") String id);
    int sameStatusLines(@Param("status") String status ,@Param("deliveryId") String id);
    /**
     * 分页
     * @param page
     * @param params
     * @return
     */
    IPage<TbWmsMaterialDeliveryLineVo> findAll(Page page, @Param("params") TbWmsMaterialDeliveryLineSearchParam params);

    /**
     * 分页
     * @param page
     * @param params
     * @return
     */
    IPage<TbWmsMaterialDeliveryLineptVo> findAll1(Page page, @Param("params") TbWmsMaterialDeliveryLineSearchParam params);

}
